let install = {
	computed: {
		$user() {
			return this.$store?.userInfo || ""
		},
		$config() {
			return this.$store?.config || ""
		},
		$params() {
			return this.pageData
		}
	},
	data() {
		return {
			pageData: '',
			page: 1, //页面的分页
		}
	},
	onLoad(e) { //页面打开
		this.pageData = e
		this.shareData = {
			title: '',
			imageUrl: '',
			path: '',
		}
		if (e.tit) uni.setNavigationBarTitle({
			title: e.tit
		})
		/* 判断是不是带邀请码 */
		if (e.shopToken) this.$setData('shopToken', e.shopToken) //多商家
		if (e.regcode) uni.setStorageSync('regcode', e.regcode)
		/* 扫小程序码的参数  只有邀请码 */
		if (e.scene) uni.setStorageSync('regcode', e.scene)
	},
	// //页面显示
	// onShow() {
	// 	/* 用于h5是 无 title 时 展示链接问题 */
	// 	this.$nextTick(() => {
	// 		let navTitle = document.getElementsByTagName('title')[0];
	// 		console.log(navTitle);
	// 		navTitle.innerText = '陪诊'
	// 	})
	// },
	//页面加载完成
	onReady() {

		// 	// console.log(res);
		// 	// this.$refs?.uForm?.setRules(this.$rules);
	},
	// #ifdef MP-WEIXIN
	onShareAppMessage() {
		let pages = getCurrentPages()
		let page = pages[pages.length - 1]
		let path = decodeURI(page.$page.fullPath)
		path.indexOf('?') == -1 ? path += '?' : path += '&'
		this.shareData.path = `${path}regcode=${uni.getStorageSync('userInfo').regcode}`
		return this.shareData
	},
	onShareTimeline() {
		let pages = getCurrentPages()
		let page = pages[pages.length - 1]
		let path = decodeURI(page.$page.fullPath)
		let query = path.split('?')[1] || ''
		this.shareData.query = query + `&regcode=${uni.getStorageSync('userInfo').regcode}`
		return this.shareData
	},
	// #endif
	onPullDownRefresh() {
		if (this.onPullDownRefresh) return
		this.$refresh().then(res => {
			this.$nextTick().then(res => {
				uni.showToast({
					title: '刷新成功',
					icon: "none",
					mask: false
				})
				uni.stopPullDownRefresh()
			})
		})
	}
}
export default install